<script>

var cod;
var todos = 1;

function saveDesconto()
{
	$.post("pedido/savedesconto", {caf04_cod: cod, desconto: $("#desc_inp").val(), caf04_cod_item: <?php echo $this->arr_coment[0]["caf04_cod_item"]; ?>, caf04_cod_prod: <?php echo $this->arr_coment[0]["caf04_cod_prod"]; ?>, caf04_coment: $("#text_coment").val(), all: todos}, function(){$('#coment_all').hide(); listProd();});
	msg({vmsg: "Desconto Salvo.",time: 3000});
	$("#descontoDiv").hide();
}

function mostraMesa(un)
{
	$(".mesa_img").hide();
	$(".mesas_" + un).slideDown("fast");
}

function setCadeira(obj)
{
	$(obj).css("background-color", "red");
}

function addTxtComent(txt)
{
	$("#text_coment").html(txt + "; ");
}

$(function(){
	//keybnumShow({elm: '#desc_inp', title: 'Desconto'});
});

</script>

<div class="blk_screen" style="opacity: 0.8; position: fixed; z-index: 998; width: 100%; height: 100%; background-color: white; top: 0; left: 0;"></div>

<div id="desconto_all">
	<div class="ui-corner-all" style="border: 1px solid #B0ADAD; padding: 10px; background: white; position: fixed; z-index: 999; top: 30px; width: 500px; left: 50%; margin-left: -250px;">
		<div id="titlekeyNum" class="ui-widget ui-corner-all" style="font-size: 22px; text-align: left; color: gray">
			Desconto de <font color="red">R$</font><input style="color: red; border: 0;" type="text" id="desc_inp" value="<?php echo Num::money($this->desconto); ?>" />
		</div>
		<hr style="border-top: 1px dashed gray; margin-top: 5px; margin-bottom: 5px;" />
		<div style="">
			<div class="button ui-corner-all" onclick="$('#desc_inp').val(0); saveDesconto(); $('#div_key').fadeOut();" style="text-align: center; float: left; padding: 20px; width: 201px;">
				<b>Tirar Desconto</b>
			</div>
			<div class="button ui-corner-all" onclick="keybnumShow({elm: '#desc_inp', title: 'Valor Desconto'});" style="text-align: center; padding: 20px; margin-left: 256px; width: 201px;">
				<b>Desconto</b>
			</div>
		</div>
		<hr style="margin: 10px 0 10px 0;" />
		<div>
			<div class="button ui-corner-all" onclick="saveDesconto(); $('#div_key').fadeOut();" style="text-align: center; float: left; padding: 20px; width: 201px;">
				<div style="position: absolute; margin-top: -9px; margin-left: -10px;">
					<img src="public/images/actions/yes.png" />
				</div>
				<b>Salvar</b>
			</div>
			<div class="button ui-corner-all" onclick="$('#descontoDiv').hide(); $('.bg_transp').hide(); $('#div_key').fadeOut();" style="text-align: center; padding: 20px; margin-left: 256px; width: 201px;">
				<div style="position: absolute; margin-top: -9px; margin-left: -10px;">
					<img src="public/images/actions/delete.png" />
				</div>
				<b>Cancelar</b>
			</div>
		</div>
	</div>
</div>